<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link href="/css/bootstrap.css" rel="stylesheet">
</head>
<body>
<div th:include="~{main/index :: nav}"></div>
<h3>排课管理<span style="color: red" th:text="${state}"/></h3>
<hr>
<div style="display: flex;justify-content: space-around;">
    <div  style="width: 67%;">
        <table class="table table-hover table-striped table-bordered"  border="1" width="95%" style="text-align: center;">
            <tbody>
            <tr>
                <th>教师ID</th>
                <th>教师名称</th>
                <th>班级编号</th>
                <th>班级名称</th>
                <th>课程号</th>
                <th>课程名称</th>
                <th>操作</th>
            </tr>
            <tr th:each="taskInfo:${taskInfos}">
                <td><span th:text="${taskInfo.tid}"></span></td>
                <td><span th:text="${taskInfo.uname}"></span></td>
                <td><span th:text="${taskInfo.clz.clzno}"></span></td>
                <td><span th:text="${taskInfo.clz.clzname}"></span></td>
                <td><span th:text="${taskInfo.course.cno}"></span></td>
                <td><span th:text="${taskInfo.course.cname}"></span></td>
                <td><a th:href="'/adm/task/del/'+${taskInfo.kid}"><button class="btn btn-warning">删除</button></a></td>
            </tr>
            </tbody>
        </table>
    </div>
    <div>
        <button><a href="/adm/task/show">添加新的排课-安排某位教师到某班上某课</a></button>
        <hr>
        <div>
            <form action="/adm/task/doAdd" method="post">
                <table class="table table-hover table-striped table-bordered">
                    <tr>
                        <th>教师:</th>
                        <td><select name="tid" size="1">
                            <option th:each="tea:${teas}"
                                    th:value="${tea.uid}"
                                    th:text="${tea.uname}"></option>
                        </select></td>
                    </tr>
                    <tr>
                        <th>班级:</th>
                        <td><select name="clzno" size="1">
                            <option th:each="clz:${clzs}"
                                    th:value="${clz.clzno}"
                                    th:text="${clz.clzname}"></option>
                        </select></td>
                    </tr>
                    <tr>
                        <th>课程:</th>
                        <td><select name="cno" size="1">
                            <option th:each="course:${courses}"
                                    th:value="${course.cno}"
                                    th:text="${course.cname}"></option>
                        </select></td>
                    </tr>
                    <tr>
                        <th></th>
                        <td><button class="btn-warning">添加排课</button> </td>
                    </tr>
                </table>
            </form>
        </div>
    </div>
</div>

</body>
</html>